<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display"%>
<%@ taglib uri="/WEB-INF/config/tld/fmt.tld" prefix="fmt"%>
<%@ taglib uri="http://ssh.org/selects" prefix="ssh"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 


<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
	String applicationPath = basePath + "/" + "application";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title></title>
		<link href="<%=path%>/css/jinmu_style.css" rel="stylesheet"
			type="text/css" />
		<script language="javascript" src="<%=path%>/js/util.js"></script>
		<script language="javascript" src="<%=path%>/js/SyncCommon.js"></script>
		<script language="javascript"
			src="<%=path%>/application/js/treeSelect.js"></script>
	</head>
	<body>
		<div id="divTree"
			style="position: absolute; background: #FFFFFF; left: 1px; top: 1px; height =250; width: 253px; display: none"></div>
		<html:form styleId="usertableForm" action="updateUsertable.do?method=updateUsertable"
			onsubmit="return save();">
			<html:hidden property="id" value="${usertable.id}" />
			<table cellspacing="0" cellpadding="0" width="98%" align="center"
				border="0" class="margtb5">
				<tr>
					<td align="left" class="padl5 lan12">
						<img src="<%=path%>/images/img-11.gif" width="12" height="12">
						系统管理 &gt; 用户管理 &gt; 编辑
					</td>
				</tr>
			</table>


			<table cellspacing="1" cellpadding="0" width="98%" align="center"
				border="0" class="bgcolor2 margb5">

				<tr class="bgcolor">
					<td width="18%" align="right" class="zi13">
						<bean:message
							key="com.application.usertable.entity.usertable.createpage.rname"
							bundle="usertableKey" />
						：
					</td>
					<td width="32%" align="left" class="pad2 zi13">
						<input type="text" id="rname" name="rname" flag="true"
							valid="required" errMsg="请输入姓名！" size="30" value="${usertable.rname}"/>
						<font color="red">*</font>

					</td>

					<td width="18%" align="right" class="zi13">
						<bean:message
							key="com.application.usertable.entity.usertable.createpage.username"
							bundle="usertableKey" />
						：
					</td>
					<td width="32%" align="left" class="pad2 zi13">
						<input type="text" id="username" name="username" size="30"  value="${usertable.username}"/>
					</td>
				</tr>
				<c:choose>
					<c:when test="${usertable.password==null||usertable.password==''}">
				
				  <tr class="bgcolor">
					<td width="18%" align="right" class="zi13">
						<bean:message
							key="com.application.usertable.entity.usertable.createpage.password"
							bundle="usertableKey" />
						：
					</td>
					<td width="32%" align="left" class="pad2 zi13">
						<input type="password" id="password" name="password" size="30"  value="${usertable.password}"/>

					</td>
					<td width="18%" align="right" class="zi13">
						确认密码 ：
					</td>
					<td width="32%" align="left" class="pad2 zi13">
					<input type="hidden" id="passtype" name="passtype" size="30"  value="add"/>
						<input type="password" id="rpassword" name="rpassword"  size="30" value="${usertable.password}"/>
					</td>
				</tr>
					</c:when>
					<c:otherwise>
						<input type="hidden" id="password" name="password" size="30"  value="${usertable.password}"/>
					</c:otherwise>
				</c:choose>
				<tr class="bgcolor">
					<td width="18%" align="right" class="zi13">
						<bean:message
							key="com.application.usertable.entity.usertable.createpage.level"
							bundle="usertableKey" />
						：
					</td>
					<td width="32%" align="left" class="pad2 zi13">
						<ssh:select propertyName="level" pid="USER_JB" type="2" defaultName="${usertable.level}"/>

					</td>
					<td width="18%" align="right" class="zi13">
						<bean:message
							key="com.application.usertable.entity.usertable.createpage.org"
							bundle="usertableKey" />
						：
					</td>
					<td width="32%" align="left" class="pad2 zi13">
						<input type="text" id="org" name="org" size="30" flag="true"
							valid="required" errMsg="请选择部门！" value="${usertable.org}"
							onClick="openTree('divTree','bms','${pageContext.request.contextPath}/common/treeSelect.jsp?iid=oid&iname=org',this)" />
						<font color="red">*</font>
						<input type="hidden" id="oid" name="oid" value="${usertable.oid}"/>
					</td>
				</tr>
				<tr class="bgcolor">
					<td width="18%" align="right" class="zi13">
						<bean:message
							key="com.application.usertable.entity.usertable.createpage.sex"
							bundle="usertableKey" />
						：
					</td>
					<td width="32%" align="left" class="pad2 zi13">
						<select id="sex" name="sex" >
							<option ${usertable.sex=="男"?"selected":""}>
								男
							</option>
							<option ${usertable.sex=="女"?"selected":""}>
								女
							</option>
						</select>

					</td>
					<td width="18%" align="right" class="zi13">
						<bean:message
							key="com.application.usertable.entity.usertable.createpage.birthday"
							bundle="usertableKey" />
						：
					</td>
					<td width="32%" align="left" class="pad2 zi13">
<ssh:select firstShow="N" propertyName="birthday" dataSource="collection" selectList="${yearSelect}"  type="1" defaultName="${usertable.birthday}"/> 
					</td>
				</tr>

				<tr class="bgcolor">
					<td width="18%" align="right" class="zi13">
						<bean:message
							key="com.application.usertable.entity.usertable.createpage.school"
							bundle="usertableKey" />
						：
					</td>
					<td width="32%" align="left" class="pad2 zi13">
						<input type="text" id="school" name="school"  size="30" value="${usertable.school}"/>
					</td>
					<td width="18%" align="right" class="zi13">
						<bean:message
							key="com.application.usertable.entity.usertable.createpage.education"
							bundle="usertableKey" />
						：
					</td>
					<td width="32%" align="left" class="pad2 zi13">
						<ssh:select propertyName="education" pid="USER_XL" type="2" defaultName="${usertable.education}"/>
					</td>
				</tr>




				<!--  -->
				<tr class="bgcolor">
												<td width="18%" align="right" class="zi13">
						<bean:message
							key="com.application.usertable.entity.usertable.createpage.specialty"
							bundle="usertableKey" />
						：
					</td>
					<td width="32%" align="left" class="pad2 zi13">
						 <ssh:select propertyName="specialty" pid="USER_ZC" type="6" defaultName="${usertable.specialty}"/>

					</td>
					<td width="18%" align="right" class="zi13">
						<bean:message
							key="com.application.usertable.entity.usertable.createpage.tel"
							bundle="usertableKey" />
						：
					</td>
					<td width="32%" align="left" class="pad2 zi13">
						<input type="text" id="tel" name="tel" size="30" value="${usertable.tel}" flag="true"
							valid="required|isMobile" errMsg="请输手机号！|请输正确的手机号！"/>
<font color="red">*</font>
					</td>
					
				</tr>
				
				<tr class="bgcolor">
				<td width="18%" align="right" class="zi13">
						<bean:message
							key="com.application.usertable.entity.usertable.createpage.EMAIL"
							bundle="usertableKey" />
						：
					</td>
					<td width="32%" align="left" class="pad2 zi13">
						<input type="text" id="EMAIL" name="EMAIL" size="30" value="${usertable.EMAIL}" flag="true"
							valid="required|isEmail" errMsg="请输邮箱！|请输入正确的邮箱！"/><font color="red">*</font>
					</td>
					<td width="18%" align="right" class="zi13">
						<bean:message
							key="com.application.usertable.entity.usertable.createpage.QQ"
							bundle="usertableKey" />
						：
					</td>
					<td width="32%" align="left" class="pad2 zi13">
						<input type="text" id="QQ" name="QQ"  value="${usertable.QQ}" flag="true"
							valid="isNumber" errMsg="请输正确QQ号码！"/>

					</td>
					</tr>
					<tr class="bgcolor">
										<td width="18%" align="right" class="zi13">
						职称
						：
					</td>
					<td width="32%" align="left" class="pad2 zi13" >
						<input type="text" id="titles" name="titles" size="30" maxlength="50" value="${usertable.titles}"/>

					</td>
					<td width="18%" align="right" class="zi13">
						用户角色：
					</td>
					<td align="left" class="pad2 zi13" >
						<input type="text" value="${roleNames}" id="roleName" name="roleName" size="30" readonly="readonly"
							onClick="${usertable.username=="admin"?"":"openTree('divTree','role','common/treeSelect.jsp?iid=roleId&iname=roleName',this)"}" />
						<input type="hidden" value="${roleIds}" id="roleId" name="roleId" />
						<input type="button" value="清除角色"  onclick="clearValue('roleId','roleName')" ${usertable.username=="admin"?"disabled='disabled'":""}/>
						
					</td>
				</tr>
			</table>



			<p>
			<p>
			<p>
			<table width="98%" align="center" border="0" cellspacing="0"
				cellpadding="0">
				<tr>
					<td align="center">
						<input class="buttonbg" id="but_save" type="submit"
							style="cursor: hand"
							value="<bean:message key='com.manager.common.usertable.save' bundle="usertableKey"/>"
							name="but_save" />
						&nbsp;&nbsp;&nbsp;
						<input class="buttonbg" id="but_return" type="button"
							style="cursor: hand"
							value="<bean:message key='com.manager.common.usertable.return' bundle="usertableKey"/>"
							name="but_return" onClick="javascript:history.go(-1);" />
					</td>
				</tr>
			</table>

		</html:form>
	</body>
</html>


<script>

function save(){
   if(validateForm(document.forms[0],'Y'))
   {
	return true;
    }else{
	return false;
    }
}

function chooseProject(){   
    var syncHelper = new SyncHelper();
	var url = "popuSelectProjectList.do?method=popuSelectProjectList&random=" + new Date();
	var searchWin = window.showModalDialog(url,window,"help:no;scroll:yes;resizable:no;status:0;dialogWidth:1000px;dialogHeight:600px;center:yes" ); 	
    if(searchWin){
         $("projectName").value = searchWin["projectName"]==undefined?"":searchWin["projectName"];
		 $("projectNo").value = searchWin["projectNo"]==undefined?"":searchWin["projectNo"];
		 syncHelper.selectedByValue(searchWin["projectOrg"],"projectOrg");
		
		 
		 //$jq("#projectOrg option").not(":selected").attr("disabled", "disabled");

		 
    }
}
</script>





